package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AWareFlMapper;
import com.ruoyi.system.domain.AWareFl;
import com.ruoyi.system.service.IAWareFlService;

/**
 * 发料配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-15
 */
@Service
public class AWareFlServiceImpl implements IAWareFlService 
{
    @Autowired
    private AWareFlMapper aWareFlMapper;

    /**
     * 查询发料配置
     * 
     * @param id 发料配置主键
     * @return 发料配置
     */
    @Override
    public AWareFl selectAWareFlById(Long id)
    {
        return aWareFlMapper.selectAWareFlById(id);
    }

    /**
     * 查询发料配置列表
     * 
     * @param aWareFl 发料配置
     * @return 发料配置
     */
    @Override
    public List<AWareFl> selectAWareFlList(AWareFl aWareFl)
    {
        Long deptId = SecurityUtils.getLoginUser().getDeptId();
        aWareFl.setGroupId(deptId.toString());
        return aWareFlMapper.selectAWareFlList(aWareFl);
    }

    /**
     * 新增发料配置
     * 
     * @param aWareFl 发料配置
     * @return 结果
     */
    @Override
    public int insertAWareFl(AWareFl aWareFl)
    {
        Long deptId = SecurityUtils.getLoginUser().getDeptId();
        aWareFl.setGroupId(deptId.toString());
        return aWareFlMapper.insertAWareFl(aWareFl);
    }

    /**
     * 修改发料配置
     * 
     * @param aWareFl 发料配置
     * @return 结果
     */
    @Override
    public int updateAWareFl(AWareFl aWareFl)
    {
        Long deptId = SecurityUtils.getLoginUser().getDeptId();
        aWareFl.setGroupId(deptId.toString());
        return aWareFlMapper.updateAWareFl(aWareFl);
    }

    /**
     * 批量删除发料配置
     * 
     * @param ids 需要删除的发料配置主键
     * @return 结果
     */
    @Override
    public int deleteAWareFlByIds(Long[] ids)
    {
        return aWareFlMapper.deleteAWareFlByIds(ids);
    }

    /**
     * 删除发料配置信息
     * 
     * @param id 发料配置主键
     * @return 结果
     */
    @Override
    public int deleteAWareFlById(Long id)
    {
        return aWareFlMapper.deleteAWareFlById(id);
    }
}
